Page({
  onLoad({ id }) {
    this.getHouseDetail(id)
  },
  async getHouseDetail(id) {
    if (!id) return
    const { code, data: houseDetail } = await wx.http.get(`/room/${id}`)
    if (code !== 10000) return wx.utils.toast('获取房屋详情失败')
    this.setData({
      ...houseDetail,
    })
  },
  // 跳转到修改房屋信息页面
  editHouse() {
    wx.navigateTo({
      url: `/house_pkg/pages/form/index?id=${this.data.id}`,
    })
  },
})
